<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="../common/header.jsp"%>
<div class="clearfix"></div>
<div class="row">
  <div class="col-md-12 col-sm-12 col-xs-12">
    <div class="x_panel">
      <div class="x_title">
        <h2>修改APP <i class="fa fa-user"></i></h2>
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        <div class="clearfix"></div>
        <form class="form-horizontal form-label-left" action="doUpdate" method="post" enctype="multipart/form-data">
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="versionName">版本名称 <span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input id="versionName" class="form-control col-md-7 col-xs-12" 
               data-validate-length-range="20" data-validate-words="1" name="versionName"  required="required" placeholder="请输入版名称" type="text" value="${appInfo.versionName }">
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="versionCode">版本号 <span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input id="versionCode" class="form-control col-md-7 col-xs-12" 
               data-validate-length-range="20" data-validate-words="1" name="versionCode"  required="required" placeholder="请输入版号" type="text" value="${appInfo.versionCode}">
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="select">所属平台 <span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <select name="appType" id="flatformId" class="form-control" required="required">
              	<c:choose>
					<c:when test="${appInfo.appCategory1.id==1}">
						<option value="1" selected="selected">android应用</option>
					</c:when>
					<c:otherwise>
						<option value="1">android应用</option>
					</c:otherwise>
				</c:choose>	
				<c:choose>
					<c:when test="${appInfo.appCategory1.id==2}">
						<option value="2" selected="selected">ios应用</option>
					</c:when>
					<c:otherwise>
						<option value="2">ios应用</option>
					</c:otherwise>
				</c:choose>
              </select>
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="select">一级分类 <span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <select name="categoryLevel1" id="categoryLevel1" class="form-control" required="required">
              	<option value="">请选择一级分类</option>
				<c:forEach items="${level1List}" var="appCategory">
					<c:choose>
						<c:when test="${appCategory.id==appInfo.appCategory1.id }">
							<option value="${appCategory.id}" selected="selected">${appCategory.categoryName}</option>
						</c:when>
						<c:otherwise>
							<option value="${appCategory.id}">${appCategory.categoryName}</option>
						</c:otherwise>
					</c:choose>				
				</c:forEach>
              </select>
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12"  for="select">二级分类 <span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <select name="categoryLevel2" id="categoryLevel2" class="form-control" required="required">
              	<option value="${appInfo.appCategory2.id }">${appInfo.appCategory2.categoryName}</option>
              </select>
            </div>
          </div>
          
          <div class="item form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="img">LOGO图片 <span class="required">*</span></label>
            <div class="col-md-6 col-sm-6 col-xs-12">
            <img src="${ctx}/statics/fileUpload/${appInfo.imgUrl}" width="100px" height="100px">
            <input type="file" class="form-control col-md-7 col-xs-12" name="img" id="a_logoPicPath" value="${appInfo.imgUrl}"/>
            ${fileError }
            </div>
          </div>
          <input name="userId" value="${user.userId }" type="hidden">
          <input name="appId" value="${appInfo.appId }" type="hidden">
          <div class="ln_solid"></div>
          <div class="form-group">
            <div class="col-md-6 col-md-offset-3">
              <button id="send" type="submit" class="btn btn-success">保存</button>
              <button type="button" class="btn btn-primary" id="back">返回</button>
              <br/><br/>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>
<%@include file="../common/footer.jsp"%>
<!-- 修改app版本所用到的js代码 -->
<script src="${pageContext.request.contextPath }/statics/localjs/version/update.js"></script>